//
//  GWLrcTool.m
//  QQ音乐
//
//  Created by qianfeng on 16/3/10.
//  Copyright © 2016年 高炜. All rights reserved.
//

#import "GWLrcTool.h"
#import "GWLrc.h"
@interface GWLrcTool ()
@end
@implementation GWLrcTool
+(NSArray *)lrcArrayWithLrcFileName:(NSString *)fileName
{
    NSMutableArray *lrcArray =[NSMutableArray array];
    NSString *filePath =[[NSBundle mainBundle]pathForResource:fileName ofType:nil];
    NSString *str =[NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
    NSArray *tmpArray =[str componentsSeparatedByString:@"\n"];
    for (NSString *littleLrc in tmpArray) {
        if ([littleLrc hasPrefix:@"[ti"]||[littleLrc hasPrefix:@"[ar"]||[littleLrc hasPrefix:@"[al"]||![littleLrc hasPrefix:@"["]) {
            continue;
            
        }
        
        [lrcArray addObject:[GWLrc lrcWithLrcString:littleLrc]];
    }
    
    return lrcArray;
}
@end
